/*
 * mox_comm.h
 *
 *  Created on: Jul 11, 2010
 *      Author: jmonk
 */

#ifndef MOX_COMM_H_
#define MOX_COMM_H_

typedef enum {
	SIG_MSG=0x100,
	SIG_KILL,
	SIG_READY,
	SIG_IFREE,
	SIG_OFREE,
	SIG_ICONN,
	SIG_OCONN,
	SIG_IDISC,
	SIG_ODISC,
	SIG_NONE,
	SIG_ACK,
	SIG_NACK,

	MOX_MSG=0x010,
	MOX_REQ_MOD,
	MOX_REQ_THD,
	MOX_REQ_MOD_ID,
	MOX_REQ_THD_ID,
	MOX_COM_CMP,
	MOX_ACK,
	MOX_CMD,
	MOX_OOM,
	MOX_ABRT,
	MOX_INVLD_ARG,
	MOX_CREATE_TH,
	MOX_INIT_CRTH,
	MOX_UPDATE,
	MOX_NACK,

	LOG_MESSAGE=0x300,
	LOG_END,
	LOG_ACK,
	LOG_NACK,
	LOG_REQ_ADD,

	MOD_MSG=0x400,
	MOD_INVALID,
	MOD_LAUNCH,
	MOD_UPDATE,
	MOD_BUSY,
	MOD_READY,
	MOD_TYPE,
	MOD_STORAGE,
	MOD_GEN,
	MOD_ACK,
	MOD_NACK,

	STORAGE_MSG=0x500,
	STORAGE_NONE,
	STORAGE_FREE,
	STORAGE_BUSY,
	STORAGE_LOCK,
	STORAGE_UNLK,
	STORAGE_READ,
	STORAGE_WRTE,
	STORAGE_WAIT,
	STORAGE_NACK,
	STORAGE_ACK,
	STORAGE_CLR,

	TH_MSG=0x600,
	TH_REQ_TYPE,
	TH_REQ_THD,
	TH_REQ_INFO,
	TH_TYPE_MOD,
	TH_TYPE_APP,
	TH_TYPE_MOX,
	TH_SET_ID,
	TH_RELEASE,
	TH_ACK,
	TH_NACK,
	TH_PARAM,
	TH_REQ_COM,
	TH_END_COM,
	TH_START_MOD,
	TH_START_APP,
	TH_REQ_CFG,
	TH_SET_CFG,
	TH_CON_REQ,
	TH_DIS_REQ,
	TH_LST_REQ,
	TH_DTL_REQ,

	MOX_COMM_RD=0x020,
	MOX_COMM_WR,
	MOX_COMM_CMP
} mox_msg_t;

typedef struct mox_msg {
	mox_msg_t type;
	unsigned size;

#ifndef __XC__
	unsigned char *content;
#else
	unsigned content;
#endif
} mox_msg;

#include "mox_comm_chans.h"
#include "mox_comm_c.h"
#include "mox_comm_xc.h"

#endif /* MOX_COMM_H_ */
